home *** CD-ROM | disk | FTP | other *** search
- Path: news1.intercall.com!usenet
- From: engevar@intercall.com (Steven Ovits)
- Newsgroups: comp.lang.c++
- Subject: Re: Help Please
- Date: Sat, 30 Mar 1996 23:30:53 GMT
- Organization: Intercall Inc.
- Message-ID: <4jk6k5$9s0@news1.intercall.com>
- References: <4ji7eo$kgm@daisy.flex.com.au>
- NNTP-Posting-Host: ts2-111.intercall.com
- X-Newsreader: Forte Free Agent 1.0.82
-
- cobweb@flex.com.au (Tony L) wrote:
-
- >Hi all,
-
- >I have this prog that I can't get to do a simple IF condition
- >properly. I just want it to say "You have voted for Paul Keating" if
- >the user enters Paul Keating. Yeah! I know, stupid idea for a
- >program :-)))
-
- Relevant code follows
- > if (last2 == him)
- > { printf("you have voted for Paul Keating!"); }
- > else
- > { printf("\nYou didn't vote for Paul Keating!"); }
-
- C strings are arrays of char.
- You can't compare arrays using the == operator.
- Use strcmp from the library.
-
-
-